
const showNav = function (cname) {
    let footer = document.createElement('footer')
    document.body.append(footer)
    footer.className = 'foot'
    footer.innerHTML = `
    <a href="./index.html">
            <p class="${cname === 'home' ? "active" : ""}">
                <span class="iconfont icon-shouye1"></span>
                首页
            </p>
        </a>
        <a href="./run.html">
            <p class="${cname === 'run' ? "active" : ""}">
                <span class="iconfont icon-yaling"></span>
                运动
            </p>
        </a>
        <a href="./circle.html">
            <p class="${cname === 'circle' ? "active" : ""}">
                <span class="iconfont icon-quanzi"></span>
                圈子
            </p>
        </a>
        <a href="./mine.html">
            <p class="${cname === 'mine' ? "active" : ""}">
                <span class="iconfont icon-wode"></span>
                我的
            </p>
        </a>
    
    `
}

const showtopNav = function (travel) {
    let nav = document.createElement('nav')
    document.body.prepend(nav)
    nav.className = 'navtop'
    nav.innerHTML = `
    <a href="./run.html" class="${travel === 'run' ? 'on' : ''}">跑步</a>
    <a href="./cycling.html" class="${travel === 'cycling' ? 'on' : ''}">骑行</a>
    <a href="./curriculum.html" class="${travel === 'curriculum' ? 'on' : ''}">课程训练</a>
    `
}
module.exports = {
    showNav,
    showtopNav
}